'use strict'
const { query } = require('../app/helper/db');

module.exports.up = function (next) {
  query(`
    CREATE TABLE productOption (
      id int(11) unsigned NOT NULL AUTO_INCREMENT,
      name varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL comment '',
      price int(11) unsigned NOT NULL comment '',
      originPrice int(11) unsigned NOT NULL comment '',
      salesVolume int(11) unsigned NOT NULL comment '',
      productid int(11) unsigned NOT NULL comment '',
      createdat int(11) NOT NULL comment '',
      PRIMARY KEY (id)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
  `).then(() => {
    next();
  }).catch(err => {
    throw err;
  })
}

module.exports.down = function (next) {
  next()
}
